/*
 * @Date: 2024-09-27 15:10:55
 * @LastEditors: Lcx l1556461835@163.com
 * @LastEditTime: 2024-11-12 15:10:55
 * @FilePath: \frontEnd\nuxt.config.js
 * @Description: 
 */
module.exports = {
  head: {
    title: "合同评审",
    meta: [
      { charset: "utf-8" },
      { name: "viewport", content: "width=device-width, initial-scale=1" },
      { hid: "description", name: "description", content: "Nuxt.js project" }
    ],
    link: [{ rel: "icon", type: "image/x-icon", href: "/nercar.jpg" }]
  },
  loading: { color: "#3B8070" },
  css: [
    { src: "~assets/css/elementChange.scss", lang: "scss" },
    "@/assets/css/baseStyle.scss",
    "@/assets/icon/iconfont.css"
  ],
  plugins: [
    "@/plugins/element-ui",
    "@/plugins/directive",
    "@/plugins/i18n",
    "@/plugins/enumeration",
    { src: "@/plugins/api", ssr: false },
    { src: "~/plugins/vue-global.js", ssr: false }
  ],
  modules: ["@nuxtjs/axios", "@nuxtjs/proxy"],
  server: {
    port: 8200,
    host: "0.0.0.0"
  },
  axios: {
    baseURL: "http://192.168.5.129:8089/", // 设置统一URL,关闭代理时使用.
    timeout: 60000,
    retry: { retries: 3 },
    proxy: true
  },
  proxy: {
    "/api": {
      target: "http://192.168.5.129:8089/", // 目标接口域名
      pathRewrite: { "^/api/": "" }, // 匹配 /api 替换成 /
      changeOrigin: true // 表示是否跨域
    }
  },
  build: {
    extend(config, { isDev, isClient }) {
      if (isDev && isClient) {
        config.module.rules.push({
          enforce: "pre",
          test: /\.(js|vue)$/,
          loader: "eslint-loader",
          exclude: /(node_modules)/
        });
      }
    }
  }
};
